Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pingsource storage to v1alpha2 #3274

Merged
merged 4 commits into from
Jun 15, 2020

Conversation

lionelvillard
Copy link
Member

@lionelvillard lionelvillard commented Jun 4, 2020

Proposed Changes

  • PingSource reconciler uses v1alpha2 API

Release Note

- 🧽 Update or clean up current behavior
Reconcile PingSource using v1alpha2 API

Docs

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 4, 2020
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 4, 2020
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-eventing-integration-tests 0/3

Failed non-flaky tests preventing automatic retry of pull-knative-eventing-integration-tests:

test/e2e.TestPingSourceV1Alpha1
test/e2e.TestPingSourceV1Alpha2ResourceScope

@knative-prow-robot knative-prow-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 4, 2020
@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Jun 4, 2020
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)

pingsourceinformer "knative.dev/eventing/pkg/client/injection/informers/sources/v1alpha1/pingsource"
pingsourcereconciler "knative.dev/eventing/pkg/client/injection/reconciler/sources/v1alpha1/pingsource"
"knative.dev/eventing/pkg/apis/sources/v1alpha2"
"knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format Go code:

Suggested change
"knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding"

kubeclient "knative.dev/pkg/client/injection/kube/client"
deploymentinformer "knative.dev/pkg/client/injection/kube/informers/apps/v1/deployment"
"knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format Go code:

Suggested change
"knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"
"knative.dev/pkg/client/injection/kube/informers/core/v1/serviceaccount"
"knative.dev/pkg/client/injection/kube/informers/rbac/v1/rolebinding"

@lionelvillard lionelvillard changed the title WIP: upgrade pingsource storage to v1alpha2 Upgrade pingsource storage to v1alpha2 Jun 4, 2020
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2020
@@ -70,8 +70,8 @@ spec:
JSONPath: .metadata.creationTimestamp
versions:
- name: v1alpha1
served: true
storage: true
served: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work like this? I thought you needed both v1alpha1 / v1alpha2 to be served since the storage migration reads v1alpha1 then upgrades to v1alpha2, so if you remove the serving, not sure it will work?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

served: false means you cannot do kubeclt get pingsources.v1alpha1.sources.knative.dev but kubeclt get pingsources.sources.knative.dev works because of the conversion webhook. Anyway I don't know the details but it works

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, ok, well, wow, I'm really confused then :) I thought it would exactly use the pingsources.v1alpha1.sources.knative.dev (as in versioned read) of v1alpha1, then patch using v1alpha2. I think pingsources.sources.knative.dev will give you the v1alpha2 already converted. But, if you've already verified that the actual conversion happens and the storage version gets bumped, 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration tools list all resources and perform an empty patch which triggers a migration on the K8s API server.

I did it twice and it works.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 9, 2020
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 10, 2020
@@ -0,0 +1 @@
core/roles/pingsource-adapter-clusterrole.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add trailing newline:

Suggested change
core/roles/pingsource-adapter-clusterrole.yaml
core/roles/pingsource-adapter-clusterrole.yaml

@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pingsource/pingsource.go 68.6% 67.8% -0.8
pkg/reconciler/pingsource/resources/role_binding.go Do not exist 100.0%
pkg/reconciler/resources/service_account.go Do not exist 100.0%

@lionelvillard
Copy link
Member Author

/cc @n3wscott @vaikas @matzew

@lionelvillard
Copy link
Member Author

ping

@vaikas
Copy link
Contributor

vaikas commented Jun 15, 2020

/lgtm
/approve

Are there any documentation related tasks that should be done as part of this, or did they all get resolved when the API was upgraded.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 15, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lionelvillard, vaikas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [lionelvillard,vaikas]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 110e23e into knative:master Jun 15, 2020
@lionelvillard lionelvillard deleted the ping-v1alpha2 branch September 3, 2020 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants